package io.kiki.stack.netty.serialization;

import io.kiki.stack.netty.channelManager.Url;
import io.kiki.stack.netty.exception.CodecException;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) throws CodecException {
        HessianSerializer hessianSerializer = new HessianSerializer();
        List<Url> urlList = new ArrayList<>();
        for (int i = 0; i < 20000 * 50; i++) {
            Url url = new Url("1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", 12);
            urlList.add(url);
        }
        byte[] serialize = hessianSerializer.serialize(urlList);
        List<Url> deserialize = hessianSerializer.deserialize(serialize, List.class.getName());
        System.out.println(serialize.length / 1024 / 1024);
        System.out.println(deserialize.size());
    }
}
